<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-change-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${emp.id}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.badge}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.name}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.compName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.depName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.jobName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">修改信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开始时间：</label>
                    <div class="col-sm-8">
                        <input id="BeginDate" name="BeginDate" th:value="${emp.BeginDate}" class="form-control laydate-demo-1"  type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">结束时间：</label>
                    <div class="col-sm-8">
                        <input id="EndDate" name="EndDate" th:value="${emp.EndDate}" class="form-control laydate-demo-2"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目名称：</label>
                    <div class="col-sm-8">
                        <input id="ProjName" name="ProjName" th:value="${emp.ProjName}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目描述：</label>
                    <div class="col-sm-8">
                        <input id="Description" name="Description" th:value="${emp.Description}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">担任职务:</label>
                    <div class="col-sm-8">
                        <input id="Job" name="Job" th:value="${emp.Job}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目地址：</label>
                    <div class="col-sm-8">
                        <input id="ProjAddress" name="ProjAddress" th:value="${emp.ProjAddress}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目负责人:</label>
                    <div class="col-sm-8">
                        <input id="Principal" name="Principal" th:value="${emp.Principal}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "bgInfo/project";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-change-edit").serializeArray();
            var id = $("#id").val();
            var IsJoin = $("#IsJoin").val();
            var TrainType = $("#TrainType").val();
            var TrainKind = $("#TrainKind").val();
            var Content = $("#Content").val();
            var Course = $("#Course").val();
            var BeginDate = $("#BeginDate").val();
            var EndDate = $("#EndDate").val();
            var Vendor = $("#Vendor").val();
            var Place = $("#Place").val();
            var Hours = $("#Hours").val();
            var Certificate = $("#Certificate").val();
            var CertificateNo = $("#CertificateNo").val();
            var AgreementNo = $("#AgreementNo").val();
            var Abegindate = $("#Abegindate").val();
            var Aterm = $("#Aterm").val();
            var Aenddate = $("#Aenddate").val();
            var Expenses = $("#Expenses").val();
            data.push({"name": "id", "value": id});
            data.push({"name": "IsJoin", "value": IsJoin});
            data.push({"name": "TrainType", "value": TrainType});
            data.push({"name": "TrainKind", "value": TrainKind});
            data.push({"name": "Content", "value": Content});
            data.push({"name": "Course", "value": Course});
            data.push({"name": "BeginDate", "value": BeginDate});
            data.push({"name": "EndDate", "value": EndDate});
            data.push({"name": "Vendor", "value": Vendor});
            data.push({"name": "Place", "value": Place});
            data.push({"name": "Hours", "value": Hours});
            data.push({"name": "Certificate", "value": Certificate});
            data.push({"name": "CertificateNo", "value": CertificateNo});
            data.push({"name": "AgreementNo", "value": AgreementNo});
            data.push({"name": "Abegindate", "value": Abegindate});
            data.push({"name": "Aterm", "value": Aterm});
            data.push({"name": "Aenddate", "value": Aenddate});
            data.push({"name": "Expenses", "value": Expenses});
            $.operate.save(prefix + "/edit", data);
        }
    }

</script>
</body>
</html>
